package suzf.top.base.common

import android.app.Application
import android.content.Context
import suzf.top.base.injection.component.AppComponent
import suzf.top.base.injection.component.DaggerAppComponent
import suzf.top.base.injection.module.AppModule

/**
 *
 *========================
 * Created with AndroidStudio
 * Author:Mr.Su
 * Date:2019-09-08
 * Time:18:00
 * ========================
 */
open class BaseApplication: Application() {

    lateinit var appComponent: AppComponent

    override fun onCreate() {
        super.onCreate()

        initAppInjection()
        context = this
    }

    private fun initAppInjection() {
        appComponent = DaggerAppComponent.builder().appModule(AppModule(this)).build()
    }

    companion object {
        lateinit var context: Context
    }
}